<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!-- 引入meta文件 -->
<%@include file="/WEB-INF/pages/common/meta.jspf"%>

<!-- 引入header文件 -->
<%@include file="/WEB-INF/pages/common/header.jspf"%>

<!-- 引入menu文件 -->
<%@include file="/WEB-INF/pages/common/menu.jspf"%>

<body>

<article class="cl pd-20">
	<form  class="form form-horizontal" id="" novalidate="novalidate">
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>课程名称：</label>
			<div class="formControls col-xs-6 col-sm-9">
				<input type="hidden" class="input-text valid"  placeholder="" id="sId" name="sId" value="${student.sId}">
				<input type="text" class="input-text valid"  placeholder="" id="sName" name="sName" value="${student.sName}">
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input id="eidtBtn" class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>

<!-- 引入footer文件 -->
<%@include file="/WEB-INF/pages/common/footer.jspf"%>
 
<script type="text/javascript">
$(function(){
	function save(){
		var sName=$("#sName").val();
		if(!sName){
			layer.msg('学生名称不能为空');
			return;
		}
		$.ajax({
			url:"${basePath}/student/edit",
			type:'post',
			data:{
				sId:$("#sId").val(),
				sName:sName
			},
			dateType:'json',
			success:function(result){
				if(result.code==200){
					parent.reloadParent();
					parent.layer.closeAll();
				}else{
					layer.msg('修改失败');
				}
			},
			error:function(e){
				console.log("请求后台出错"+JSON.stringify(e));
			}
		});
	}
	
	$("#eidtBtn").click(function(){
		save();
	});
});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>